--Constructor, also known as ctor
local koukan = Class(function(self, inst)
	self.inst = inst
		self.maxtimepiont = 100
		self.currenttimepiont = 0
		self.married = false
end)

function koukan:DoDelta(delta)
		local val = self.currenttimepiont + delta
		if val >= self.maxtimepiont then
				self.currenttimepiont = self.maxtimepiont
	elseif val <= 0 then
				self.currenttimepiont = 0
	else
		self.currenttimepiont = val
	end
end

function koukan:GetPercent()
		return self.currenttimepiont/self.maxtimepiont
end

function koukan:OnSave()
	return 
	{
		currenttimepiont = self.currenttimepiont,
		maxtimepiont = self.maxtimepiont,
	}
end

function koukan:OnLoad(data)
    self.currenttimepiont = data.currenttimepiont
    self.maxtimepiont = data.maxtimepiont
end

function koukan:IsMarried()
	return self.married
end

return koukan